﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Orders.aspx.cs" Inherits="Business_Orders" Theme="normal" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>订餐信息管理</title>
    <style type="text/css">
       .buttons
       {
         border:1px solid #C9DEEC; 
         background-color:#FFFFFF; 
         margin-left:0px;
         height:20px;
       } 
        .test
        {
        	
	        height:25px;
	        float:left;
	        padding-left: 65px;
	        padding-top: 5px;
	        color:#2f2f2f;
	        vertical-align: middle;
	        line-height:30px;
        }
    </style>
</head>
<body style="background-color:#fcf6ec">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="Scriptmanager1" runat="server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true">
    </asp:ScriptManager>
    <div class="normalnav">
        <div class="normalcontent">
            <span style="color:#ffffff">订单管理>>></span><span style="color:#f6ff00">订餐信息管理</span>
        </div>
    </div>
        <!-- 查询框-->
        <div class="normalmenu1" style="position: absolute; z-index: 100;">
            <div class="test" style="padding-left:10px;">
                <div style="float:left; ">
                    <asp:Button ID="btn_Today" runat="server" Text=" 今天 " ToolTip="显示今天 00:00 ~ 23:59 的订餐记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_Today_Click" />
                    <asp:Button ID="btn_ThisWeekend" runat="server" Text=" 本周 " ToolTip="显示一周(周日 ~ 周六)的订餐记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_ThisWeekend_Click" />
                    <asp:Button ID="btn_ThisMonth" runat="server" Text=" 本月 " ToolTip="显示本月的订餐记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_ThisMonth_Click" />    
                    <br />    
                    <asp:Button ID="btn_LastDay" runat="server" Text=" 昨天 " ToolTip="显示前一天 00:00 ~ 23:59 的订餐记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_LastDay_Click" /> 
                    <asp:Button ID="btn_LastWeekend" runat="server" Text=" 上周 " ToolTip="显示上周的订餐记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_LastWeekend_Click" />
                
                    <asp:Button ID="btn_LastMonth" runat="server" Text=" 上月 " ToolTip="显示上月的订餐记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_LastMonth_Click" />
                    <asp:Button ID="btn_All" runat="server" Text=" 全部 " ToolTip="显示所有的订餐记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_All_Click" />       
               </div>     
                <div style=" margin-top:0px; margin-left:290px; line-height:20px;">
                    <asp:TextBox ID="txtDateA" Width="70px" runat="server" ></asp:TextBox>
                    <asp:ImageButton runat="Server" ID="Image1" ImageUrl="~/Images/Calendar_scheduleHS.png" 
                        CausesValidation="false" AlternateText="点击选择日期"/>
                    <ajaxToolkit:CalendarExtender ID="customCalendarExtender" runat="server" TargetControlID="txtDateA"
                        Format="yyyy-MM-dd" PopupButtonID="Image1"/>
                    <asp:DropDownList ID="ddl_StartHour" runat="server">
                    </asp:DropDownList>时
                    至：
                    <asp:TextBox ID="txtDateB" Width="70px" runat="server"></asp:TextBox>           
                    <asp:ImageButton runat="Server" ID="Image2" ImageUrl="~/Images/Calendar_scheduleHS.png" 
                        CausesValidation="false" AlternateText="点击选择日期" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDateB"
                        Format="yyyy-MM-dd" PopupButtonID="Image2" /> 
                    <asp:DropDownList ID="ddl_EndHour" runat="server">
                    </asp:DropDownList>时    
                    <span style="color: #426F98; font-family: 宋体; font-size: 12px">
                        <asp:Label ID="lbldate" runat="server" Text="正确的日期格式为:YYYY-MM-DD"></asp:Label>     
                    </span>      
                    <%--<br />--%>
                     <!--验证-->
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ErrorMessage="<span style='color:red; font-size:13px;'>请填写开始时间！</span>" ControlToValidate="txtDateA" Display="None"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ErrorMessage="<span style='color:red; font-size:13px;'>请填写结束时间！</span>" ControlToValidate="txtDateB" Display="None"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                             ErrorMessage="<span style='color:red; font-size:13px;'>开始日期格式不正确！</span>" ControlToValidate="txtDateA" Display="None" 
                             ValidationExpression="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"></asp:RegularExpressionValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
                             ErrorMessage="<span style='color:red; font-size:13px;'>结束日期格式不正确！</span>" ControlToValidate="txtDateB" Display="None" 
                             ValidationExpression="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"></asp:RegularExpressionValidator>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server"
                        TargetControlID="RegularExpressionValidator1" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server"
                        TargetControlID="RegularExpressionValidator2" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server"
                        TargetControlID="RequiredFieldValidator2" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server"
                        TargetControlID="RequiredFieldValidator3" >
                    </ajaxToolkit:ValidatorCalloutExtender>

                   <asp:Label ID="lbl_SendTimeValidator" runat="server" Text=""></asp:Label>
                
                    <%--<br />--%>
                    <div style="margin-top:5px;">
                    请输入订餐人姓名或订餐号码:&nbsp;
                    <asp:TextBox ID="txtPropasal" runat="server" Font-Size="14px" Width="123px" MaxLength="20"></asp:TextBox>
                    <asp:ImageButton ID="ibtnsearch" runat="server" ImageUrl="../Images/Basic/chaxun.gif"
                        OnClick="butlookout_Click" />
                    &nbsp; &nbsp;
                    <span style="color: #426F98; font-family: 宋体; font-size: 12px">注：为空则查询所有</span>
                    &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
                </div>
                    
                <%--<asp:Button ID="Button1" runat="server" Text=" 早上 " ToolTip="显示今天 00:00 ~ 12:00 的订餐记录"
                    CssClass="buttons" CausesValidation="false" OnClick="btn_Today_Click" />   --%>
                <%--<asp:Button ID="Button2" runat="server" Text=" 中午 " ToolTip="显示今天 00:00 ~ 12:00 的订餐记录"
                    CssClass="buttons" CausesValidation="false" OnClick="btn_Today_Click" />    --%> 
                </div>       
            </div>
        </div>
        
        <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Timer ID="Timer1" runat="server" Interval="300000" OnTick="Timer1_Tick">
                </asp:Timer>--%>
            
          <%--显示数据列表--%>
        <div class="normalgrid1" style="left:10px;">

            <asp:GridView ID="gvitem" runat="server" SkinID="Normal" OnPageIndexChanging="gvitem_PageIndexChanging" Width="98%"
                EmptyDataText="暂无" OnRowDataBound="gvitem_RowDataBound" AutoGenerateColumns="false" OnRowCommand="gvitem_RowCommand">
                <Columns>
                     
                     <asp:TemplateField HeaderText="序号" Visible="false" HeaderStyle-Height="35px">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lbl_No" />
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="5%"/>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                     
                    <asp:TemplateField HeaderText="订单标识" Visible="False" HeaderStyle-Width="40px" HeaderStyle-Height="35px">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="LblID" Text='<%# Eval("OrderID")%>' />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    
                     <asp:TemplateField HeaderText="订购类型" Visible="false">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="Lbl_OrderType" Text='<%# Eval("OrderType") %>' />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                        <HeaderStyle HorizontalAlign="Center" Width="10%" Height="35px" />
                    </asp:TemplateField>
                    
                     <asp:TemplateField HeaderText="发送人" HeaderStyle-Height="35px">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="Lbl_OrderMan" Text='<%# Eval("OrderMan")%>' />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="18%"/>
                        <HeaderStyle Width="15%" HorizontalAlign="Center" />
                    </asp:TemplateField>  
                    
                    <asp:TemplateField HeaderText="状态" HeaderStyle-Height="35px" Visible="false">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="Lbl_OrderStatus" Text='<%# Eval("OrderStatus")%>' />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="18%"/>
                        <HeaderStyle Width="15%" HorizontalAlign="Center" />
                    </asp:TemplateField>          
                    
                    <asp:TemplateField HeaderText="订餐内容">
                        <ItemTemplate>
                            <%--<a href='RuleView.aspx?RuleID=<%#Eval("ShortMessageID") %>'><asp:Label runat="server" ID="Lbl_RuleName" Text='<%# Eval("RuleName")%>' /></a>--%>
                            <asp:Label runat="server" ID="Lbl_OrderContent" Text='<%# Eval("OrderContent")%>' />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Left" Width="23%"/>
                        <HeaderStyle HorizontalAlign="Center" Width="23%" Height="35px" />
                    </asp:TemplateField>        
                    
                     <asp:TemplateField HeaderText="订餐份数" HeaderStyle-Width="70px" HeaderStyle-Height="35px">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="Lbl_OrderCount" Text='<%# Eval("OrderCount") %>' />
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="70px" />
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="用餐时间" HeaderStyle-Width="17%" HeaderStyle-Height="35px">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="Lbl_UseTime" Text="" />
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="17%" />
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="发送时间" >
                        <ItemTemplate>
                            <asp:Label runat="server" ID="Lbl_OrderTime" Text='<%# Eval("OrderTime") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="17%" HorizontalAlign="Center"/>
                        <ItemStyle HorizontalAlign="Center" Width="17%" /> 
                    </asp:TemplateField>
                    
                     <asp:TemplateField HeaderText="操作" HeaderStyle-Width="12%" HeaderStyle-Height="35px">
                        <ItemTemplate>
                            <asp:LinkButton ID="lb_edit" runat="server" CommandName="edit"  CausesValidation="false"
                                CommandArgument='<%#Eval("OrderID")%>'>详细</asp:LinkButton>
                            <asp:LinkButton ID="Lbl_SendSMS" runat="server" CommandName="send" CausesValidation="false"
                                CommandArgument='<%#Eval("OrderMan")%>'>回复短信</asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="12%" />
                    </asp:TemplateField>
                    
                </Columns>
                <PagerSettings Visible="False" />
            </asp:GridView>
        </div>
       
        <!--翻页按钮-->
        <div class="normalpager" id="div_pager" runat="server" style="top:450px;">
            <asp:Label ID="lbl_DCCount" runat="server"></asp:Label>
            <asp:Label ID="lblNumbers" runat="server"></asp:Label>&nbsp;&nbsp;
            <asp:LinkButton ID="btnFirst" OnClick="PagerButtonClick" runat="server" CommandArgument="0"
                CausesValidation="False">最首页</asp:LinkButton>&nbsp;
            <asp:LinkButton ID="btnPrev" OnClick="PagerButtonClick" runat="server" CommandArgument="prev"
                CausesValidation="False">前一页</asp:LinkButton>&nbsp;
            <asp:Label ID="lblCurrentIndex" runat="server"></asp:Label>&nbsp;/&nbsp;
            <asp:Label ID="lblPageCount" runat="server"></asp:Label>
            <asp:LinkButton ID="btnNext" OnClick="PagerButtonClick" runat="server" CommandArgument="next"
                CausesValidation="False">后一页</asp:LinkButton>&nbsp;
            <asp:LinkButton ID="btnLast" OnClick="PagerButtonClick" runat="server" CommandArgument="last"
                CausesValidation="False">最后页</asp:LinkButton>
        </div>
        
        
        <%--</ContentTemplate>
        </asp:UpdatePanel>--%>
    </form>
</body>
</html>
